<style tyle="text/css">
</style>
<div class="col-sm-12 mt20">

	<div class="panel panel-default">
		<div class="panel-body" ng-keyup="myKeyup($event)">
			<div class="col-xs-12 row">
				<div class="col-sm-2">
					<input type="text" class="form-control" placeholder="卡面号" ng-model="searchform.smart_card_no">
				</div>
				<div class="col-sm-2">
					<input type="text" class="form-control" placeholder="批次号" ng-model="searchform.batch">
				</div>
				<div class="col-sm-2">
					<input type="number" class="form-control" placeholder="最低余额(元)" ng-model="searchform.balance_start" min="0">
				</div>
				<div class="col-sm-2">
					<input type="number" class="form-control" placeholder="最高余额(元)" ng-model="searchform.balance_end" min="0">
				</div>
				<div class="col-sm-2">
					<button class="btn btn-info search btn-block" ng-click="cardInfo()">创建一卡通</button>
				</div>
				<div class="col-sm-2">
					<button class="btn btn-info search btn-block" ng-click="excel()">导入excel</button>
				</div>
			</div>
			<div class="col-xs-12 row mt20">
				<div class="col-sm-2">
					<ui-select ng-model="searchform.card_type" theme="bootstrap">
						<ui-select-match placeholder="选择卡类型...">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices repeat="item.code as item in category_list">
							<span ng-bind-html="item.name | highlight: $select.search"></span>
						</ui-select-choices>
					</ui-select>
				</div>
				<div class="col-sm-2"></div>
				<div class="col-sm-2"></div>
				<div class="col-sm-2"></div>
				<div class="col-sm-2">
					<!-- <input type="button " class="btn btn-info search form-control" ng-click="exportToExcel('#Excel_table')" value="导出Excel">
                    <a id="dlink" download="{{ExcelName}}.xls" ng-show="false"></a> -->
				</div>
				<div class="col-sm-2">
					<button class="btn btn-info search btn-block" ng-click="loadlist(1)">立即搜索</button>
				</div>
			</div>
		</div>

		<div class="panel-body">
			<table class="table table-striped table-bordered dataTable table-condensed tree_table" style="table-layout:fixed">
				<thead>
					<tr>
						<th class="col-md-2 text-center">卡面号/批次号</th>
						<th class="col-md-2 text-center">余额/已消费(元)</th>
						<th class="col-md-2 text-center">状态/应交押金</th>
						<th class="col-md-2 text-center">卡类型/景区</th>
						<th class="col-md-2 text-center">有效期开始/结束</th>
						<th class="col-md-2 text-center">操作</th>
					</tr>
				</thead>
				<tbody>
					<tr ng-repeat="card in cardlist">
						<td class="text-center">
							{{card.smart_card_no}}
							<br />{{card.batch}}
						</td>
						<td class="text-center">
							{{card.balance}}
							<br />{{card.spend}}
						</td>
						<td class="text-center">
							{{card.status==1?'使用中':'初始状态'}}
							<br />{{card.deposit}}
						</td>
						<td class="text-center">
							{{card.card_type_name}}
							<br />{{card.view_name}}
						</td>
						<td class="text-center">
							{{card.period_start}}
							<br />{{card.period_end}}
						</td>
						<td class="text-center">
							<!-- <button type="button" class="btn btn-info btn-xs" ng-click="detail(card)">明细</button> -->
							<button type="button" class="btn btn-info btn-xs" ng-click="updateCard(card)">修改</button>
							<button type="button" class="btn btn-info btn-xs" ng-click="updateCardInfo(card)">挂失</button>
							<button type="button" class="btn btn-info btn-xs" ng-click="cardInfo(card)">卡信息</button>
							<button type="button" class="btn btn-danger btn-xs" ng-click="delete($index)">删除</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>

		<div class="text-right" style="background-color: white; margin-right: 30px">
			<pagination total-items="totalItems" ng-model="currentPage" ng-change="loadlist(currentPage)" previous-text="上一页" next-text="下一页"
			 first-text="首页" last-text="尾页" max-size="5" boundary-links="true" rotate="false" items-per-page="itemsPerPage" class="m-t-none m-b"></pagination>
		</div>

		<table ng-show="false" id="Excel_table">
			<thead>
				<tr>
					<th class="col-md-2 text-center">卡面号</th>
					<th class="col-md-2 text-center">批次号</th>
					<th class="col-md-2 text-center">余额</th>
					<th class="col-md-2 text-center">已消费(元)</th>
					<th class="col-md-2 text-center">状态</th>
					<th class="col-md-2 text-center">应交押金</th>
					<th class="col-md-2 text-center">卡类型</th>
					<th class="col-md-2 text-center">景区</th>
					<th class="col-md-2 text-center">有效期开始</th>
					<th class="col-md-2 text-center">有效期结束</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="card in cardlist">
					<td class="text-center">
						'{{card.smart_card_no}}
					</td>
					<td class="text-center">
						'{{card.batch}}
					</td>
					<td class="text-center">
						{{card.balance}}
					</td>
					<td class="text-center">
						{{card.spend}}
					</td>
					<td class="text-center">
						{{card.status==1?'使用中':'初始状态'}}
					</td>
					<td class="text-center">
						{{card.deposit}}
					</td>
					<td class="text-center">
						{{card.card_type_name}}
					</td>
					<td class="text-center">
						{{card.view_name}}
					</td>
					<td class="text-center">
						{{card.period_start}}
					</td>
					<td class="text-center">
						{{card.period_end}}
					</td>
				</tr>
			</tbody>
		</table>

	</div>
</div>